package com.zhaogang.servlet;

import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zhaogang.employee.Employee;
import com.zhaogang.service.IEmployeeService;
import com.zhaogang.service.impl.EmployeeServiceImpl;

public class EmployeeServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
     private IEmployeeService  service = new EmployeeServiceImpl(); 
       
     public EmployeeServlet() {		
 	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		List<Employee> list= service.queryList();
		request.setAttribute("list", list);
		request.getRequestDispatcher("/employee.jsp").forward(request, response);		
		return;
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
					
		}
	
	}


